<style type="text/css">
    .header{
        text-align: center; 
        border-left: 1px solid #eaeff0;
        border-top: 1px solid #eaeff0;
        border-bottom: 1px solid #eaeff0;  
        padding: 8px 0px;
        background-color: #ffffff;
        color: #58666e
    }
    .content_style{
		text-align: center;
		padding: 8px 10px;
        border-left: 1px solid #eaeff0;
        border-bottom: 1px solid #eaeff0;
    }
	.padding10_6 {
		padding: 10px 6px;
	}
	.btn-style {
		background-color: #edf1f2;
		margin-bottom: 4px;
		width: 24px;
		height: 22px;
	}
	.height77 {
		height: 77px;
	}
	.height60 {
		height: 60px;
	}
	.percent10 {
		width: 10%;
	}
	.percent12 {
		width: 12%;
	}
	.percent15 {
		width: 15%;
	}
	.down_style {
		color:#2fa4e7;
		font-size: 12px
	}

	.l_h_40 {
		line-height:40px
	}
</style>
<div class="col-sm-12 mt20">

	<div class="panel">
		<div class="panel-body">
		  <div class="col-sm-10 control-label" style="margin-top: 8px; font-size: 15px">
			<label class="col-sm-4 control-label">机构名称 : 
			  <strong class="ng-binding">{{officeInfo.company_name}}</strong>
			</label>
			<label class="col-sm-3 control-label">机构编号 : 
			  <strong class="ng-binding">{{officeInfo.company_code}}</strong>
			</label>
			<!-- <label class="col-sm-3 control-label">总协议价 : 
				<strong class="ng-binding">{{officeInfo.agreement_money}}</strong>
				<a style="color:#2fa4e7; font-size: 13px; margin-left: 30px;text-decoration:underline" ng-click="setMoney(officeInfo)">设置</a>
			</label> -->
			<label class="col-sm-3 control-label" 
			ng-show="officeInfo.platform_product_flag == 0 && officeInfo.sys_area != officeInfo.company_code">自动获取公开产品
				<button type="button" class="btn btn-default btn-xs btn-style" ng-model="officeInfo.automatic_save" 
				btn-checkbox="" btn-checkbox-true="'1'" btn-checkbox-false="'0'" ng-click="autoSave()">
					<i class="fa fa-check text-active"></i>
				</button>
			</label>
		  </div>
		  <!-- <div class="col-sm-2">
			<button class="btn btn-info search btn-block" ng-click="setAgreementPrice()">设置协议价</button>
		  </div> -->
		  
		</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-body">
			<div class="col-lg-2-4">
				<input type="text" class="form-control" placeholder="产品名称" ng-model="searchform.name">
			</div>
			<div class="col-lg-2-4">
				<input type="text" class="form-control" placeholder="产品编号" ng-model="searchform.sale_code">
			</div>
			<!-- <div class="col-lg-3">
				<ui-select ng-model="searchform.place_code" theme="bootstrap">
					<ui-select-match placeholder="请选择一个景区">
						{{$select.selected.name}}
					</ui-select-match>
					<ui-select-choices repeat="item.place_code as item in my_place_list | filter: $select.search">
						<span ng-bind-html="item.name | highlight: $select.search"></span>
					</ui-select-choices>
				</ui-select>
			</div> -->
			<div class="col-lg-2-4">
				<ui-select ng-model="searchform.sale_category" theme="bootstrap">
					<ui-select-match placeholder="产品分类">
						{{$select.selected.label}}
					</ui-select-match>
					<ui-select-choices repeat="item.value as item in sale_category | filter: $select.search">
						<span ng-bind-html="item.label | highlight: $select.search"></span>
					</ui-select-choices>
				</ui-select>
			</div>
			<div class="col-lg-2-4">
				<button class="btn btn-info search btn-block" ng-click="search(1)">立即搜索</button>
			</div>
			<div class="col-lg-2-4">
				<button class="btn btn-danger search btn-block" ng-click="delBatch()">批量删除</button>
			</div>
		</div>

		<div class="panel-body">
			<div class="col-sm-12">
				<div class="pull-left header" style="width: 4%">
					<label class="i-checks m-b-none">
						<input type="checkbox" ng-model="all" ng-click="allSelect()"><i></i>
					</label>
				</div>
				<div class="pull-left header" style="width: 41%"><b>产品</b></div>
				<div class="pull-left header percent15"><b>产品信息</b></div>
				<div class="pull-left header" style="width: 8%"><b>产品状态</b></div>
				<div class="pull-left header percent10"><b>产品渠道</b></div>
				<div class="pull-left header percent12"><b>公开范围</b></div>
				<div class="pull-left header percent10" style="border-right:1px solid #eaeff0;"><b>操作</b></div>     
			</div>

			<h3 class="col-sm-12 text-center" ng-if="loading"><i class="fa fa-spin fa-spinner hide show inline"></i></h3>

			<div class="col-sm-12" ng-repeat="info in sale_list" ng-if="!loading">
				<div class="pull-left content_style height77" style="width: 4%"><br/>
					<label class="i-checks m-b-none" ng-show="info.type != 1">
						<input type="checkbox" ng-model="info.state"><i></i>
					</label>
				</div>
				<div class="pull-left content_style height77" style="text-align:left; width: 41%" ng-click="open(info, $index)">
					产品名称 : {{info.name}}<br/>产品编号 : {{info.code}}<br/>
					成本价：{{info.cost_price}} 元 / 指导价：{{info.guide_price}} 元 / 市场价：{{info.market_price}} 元
				</div>
				<div class="pull-left content_style height77 percent15" ng-click="open(info, $index)">
					{{info.sale_category_name}}<br/>被采购 : {{info.num}}<br/>{{info.is_platform_sale_name}}
				</div>
				<div class="pull-left content_style height77" style="width: 8%" ng-click="open(info, $index)">
					<br/>{{info.sale_apply_state_name}}
				</div>
				<div class="pull-left content_style percent10 height77" ng-click="open(info, $index)">
					<!-- 此处只显示3行文字,需要div嵌套,否则会出现第4行的文字上半截,不明所以 (๑╹◡╹) -->
					<div id={{info.code}} ng-if="info.channel_list_name != '1' " ng-bind-html="info.channel_list_name" 
					style="overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;" 
					ng-mouseenter="showChannelInfo(info)"></div>
					<div ng-if="info.channel_list_name == '1' "><br/>—</div>
				</div>
				<div class="pull-left content_style percent12 height77 text-center">
					<div style="margin-top: 10px;" ng-if="info.issysarea == 1 && info.open_sysarea != 0">
						<a style="color:#2fa4e7; text-decoration:underline" ng-click="openToDown(info, false)">
							运营商{{info.open_sysarea==1?'':'不'}}公开
						</a>
					</div>
					<br ng-if="info.issysarea != 1 || info.open_sysarea == 0"/>
					<a style="color:#2fa4e7; text-decoration:underline" ng-click="openToDown(info, true)">
							分销商{{info.open_company==0?'':'不'}}公开
					</a>
				</div>
				<div class="pull-left content_style percent10 height77" style="border-right:1px solid #eaeff0;">
					<div style="margin-top:6px">
						<button type="button" class="btn btn-info btn-xs" ng-click="PtPgrant(info)">授权</button>
						<button type="button" ng-if="info.type != 1 " class="btn btn-danger btn-xs" ng-click="delete(info)">删除</button>
					</div>
					<button type="button" class="btn btn-info btn-xs" ng-click="setChannel(info)">设置渠道</button>
				</div>
				<div ng-if="info.spread && site==$index" class="col-sm-12" style="border:1px solid #eaeff0;">
					<div class="col-sm-12 text-center padding10_6" ng-if="info.num == 0">无加价信息</div>
					<div class="col-sm-4 text-center padding10_6" ng-if="info.num != 0 && info.loading"><i class="fa fa-spin fa-spinner hide show inline"></i></div>
					<div class="col-sm-4 text-center height60" ng-if="info.num != 0 && !info.loading" ng-repeat="price in price_list">
						<div class="col-sm-7 text-right padding10_6">{{price.target_company_name}}<br/>({{price.downstream_company_code}})</div>
						<div class="col-sm-3 text-center padding10_6 l_h_40">{{'+  ' + price.floating_price}}</div>
						<div class="col-sm-2 text-left padding10_6" ng-class="{true: 'l_h_40', false: ''}[info.delBtn]">
							<a class="down_style" ng-click="setDownPrice(price)">设置</a><br/>
							<a class="down_style" ng-click="delDownPrice(info, price, $index)" ng-hide="info.delBtn">删除</a>
						</div>
					</div>
				</div>
			</div>
			<div class="text-right" ng-if="!loading">
				<pagination total-items="page.totalItems" ng-model="page.currentPage" ng-change="search(page.currentPage)" previous-text="上一页" max-size="5" 
				next-text="下一页" first-text="首页" last-text="尾页" boundary-links="true" rotate="false" items-per-page="page.itemsPerPage">
				</pagination>
			</div>

		</div>
	</div>

</div>